package com.dhcc.model;

import javax.persistence.*;

/**
 * Created by guorui on 2017/3/17.
 */
@Entity
@Table(name = "tb_choice", schema = "test", catalog = "")
public class Choice {
    private int choiceId;
    private String choiceA;
    private String choiceB;
    private String choiceC;
    private String choiceD;
    private String choiceAns;
    private int cId;

    @Id
    @Column(name = "choice_id", nullable = false)
    public int getChoiceId() {
        return choiceId;
    }

    public void setChoiceId(int choiceId) {
        this.choiceId = choiceId;
    }

    @Basic
    @Column(name = "choice_a", nullable = false, length = 8)
    public String getChoiceA() {
        return choiceA;
    }

    public void setChoiceA(String choiceA) {
        this.choiceA = choiceA;
    }

    @Basic
    @Column(name = "choice_b", nullable = false, length = 8)
    public String getChoiceB() {
        return choiceB;
    }

    public void setChoiceB(String choiceB) {
        this.choiceB = choiceB;
    }

    @Basic
    @Column(name = "choice_c", nullable = false, length = 8)
    public String getChoiceC() {
        return choiceC;
    }

    public void setChoiceC(String choiceC) {
        this.choiceC = choiceC;
    }

    @Basic
    @Column(name = "choice_d", nullable = false, length = 8)
    public String getChoiceD() {
        return choiceD;
    }

    public void setChoiceD(String choiceD) {
        this.choiceD = choiceD;
    }

    @Basic
    @Column(name = "choice_ans", nullable = false, length = 8)
    public String getChoiceAns() {
        return choiceAns;
    }

    public void setChoiceAns(String choiceAns) {
        this.choiceAns = choiceAns;
    }

    @Basic
    @Column(name = "c_id", nullable = false)
    public int getcId() {
        return cId;
    }

    public void setcId(int cId) {
        this.cId = cId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Choice choice = (Choice) o;

        if (choiceId != choice.choiceId) return false;
        if (cId != choice.cId) return false;
        if (choiceA != null ? !choiceA.equals(choice.choiceA) : choice.choiceA != null) return false;
        if (choiceB != null ? !choiceB.equals(choice.choiceB) : choice.choiceB != null) return false;
        if (choiceC != null ? !choiceC.equals(choice.choiceC) : choice.choiceC != null) return false;
        if (choiceD != null ? !choiceD.equals(choice.choiceD) : choice.choiceD != null) return false;
        if (choiceAns != null ? !choiceAns.equals(choice.choiceAns) : choice.choiceAns != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = choiceId;
        result = 31 * result + (choiceA != null ? choiceA.hashCode() : 0);
        result = 31 * result + (choiceB != null ? choiceB.hashCode() : 0);
        result = 31 * result + (choiceC != null ? choiceC.hashCode() : 0);
        result = 31 * result + (choiceD != null ? choiceD.hashCode() : 0);
        result = 31 * result + (choiceAns != null ? choiceAns.hashCode() : 0);
        result = 31 * result + cId;
        return result;
    }
}
